package modellayer;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * The Class Person.
 *@author Benjamin Ørskov
 *@author Lasse Lambertsen
 *@author Ole Kirk
 *@author Søren Søgaard
 */
public abstract class Person {

	/** The name. */
	private String name;

	/** The creation date. */
	private String creationDate;

	/** The address. */
	private String address;

	/** The city. */
	private String city;

	/** The email. */
	private String email;

	/** The phone. */
	private String phone;

	/**
	 * Instantiates a new person.
	 *
	 * @param name
	 *            the name
	 * @param address
	 *            the address
	 * @param city
	 *            the city
	 * @param email
	 *            the email
	 * @param phone
	 *            the phone
	 */
	public Person(String name, String address, String city, String email,
			String phone) {
		this.name = name;
		this.address = address;
		this.city = city;
		this.email = email;
		this.phone = phone;
		DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
		Date dateobj = new Date();
		this.creationDate = df.format(dateobj);
	}

	/**
	 * Gets the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the name.
	 *
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets the creation date.
	 *
	 * @return the creationDate
	 */
	public String getCreationDate() {
		return creationDate;
	}

	/**
	 * Sets the creation date.
	 *
	 * @param creationDate
	 *            the creationDate to set
	 */
	public void setCreationDate(String creationDate) {
		this.creationDate = creationDate;
	}

	/**
	 * Gets the address.
	 *
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * Sets the address.
	 *
	 * @param address
	 *            the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * Gets the city.
	 *
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * Sets the city.
	 *
	 * @param city
	 *            the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * Gets the email.
	 *
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * Sets the email.
	 *
	 * @param email
	 *            the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * Gets the phone.
	 *
	 * @return the phone
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * Sets the phone.
	 *
	 * @param phone
	 *            the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Navn: " + name + "\nAdresse: " + address + "\nBy: " + city
				+ "\nEmail: " + email + "\nTelefon: " + phone;
	}
}